package com.IntelligentCommunity.es.controller;

import com.IntelligentCommunity.common.core.domain.PageResult;
import com.IntelligentCommunity.common.core.domain.R;
import com.IntelligentCommunity.es.domain.vo.EsDocInsertVo;
import com.IntelligentCommunity.es.domain.vo.EsDocQueryVo;
import com.IntelligentCommunity.es.service.EsMatchingDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @Author：作者姓名
 * @Package：com.IntelligentCommunity.es.controller
 * @Project：IntelligentCommunity
 * @name：EsMatchingDataController
 * @Date：2024/7/18 23:44
 */
@RestController
@Api(tags = "Es匹配数据")
@RequestMapping("/esDoc")
public class EsMatchingDataController {

    @Autowired
    private EsMatchingDataService esMatchingDataService;

    @PostMapping("/insertCaptureData")
    @ApiOperation(value = "批量插入抓拍信息数据")
    public R<Boolean> insertCaptureData(@RequestBody List<EsDocInsertVo> esDocInsertVo){
        return esMatchingDataService.insertCaptureData(esDocInsertVo);
    }

    @PostMapping("/selectCaptureData")
    @ApiOperation(value = "查询抓拍信息数据")
    public R<PageResult> selectCaptureData(@RequestBody EsDocQueryVo esDocQueryVo){
        return esMatchingDataService.selectCaptureData(esDocQueryVo);
    }

    @PostMapping("/handleDeleteFace")
    @ApiOperation(value = "删除人脸信息匹配数据")
    public R<Boolean> handleDeleteFace(@RequestParam String id){
        return esMatchingDataService.deleteFaceInfo(id);
    }
    @PostMapping("/selectDoorAll")
    @ApiOperation(value = "查询所有门信息")
    public R<List<Map>> selectDoorAll(@RequestBody EsDocQueryVo esDocQueryVo){
        return esMatchingDataService.selectDoorAll(esDocQueryVo);
    }

}
